package com.sumu.bubei.models.login.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sumu.bubei.common.rest.entity.ResultInfo;
import com.sumu.bubei.models.login.entity.Menu;
import com.sumu.bubei.models.login.entity.vo.MenuVo;
import com.sumu.bubei.models.login.service.impl.MenuServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sumu
 * @since 2022-03-23
 */
@RestController
@RequestMapping("/menu")
@CrossOrigin
public class MenuController {

    @Autowired
    MenuServiceImpl  menuService;

    @RequestMapping("getMenu")
    public ResultInfo getMenu(Menu menu) {
        List<Menu> all = menuService.findAll(menu);
        return new ResultInfo().success(HttpStatus.OK.value(),"查詢菜單成功", all);
    }
}
